# -*- mode: makefile -*-

#  This SAMPLE Makefile can be used to compile PETSc applications
#  Copy this file to your source directory as "Makefile" and MODIFY AS NEEDED.
#  See also $PETSC_DIR/share/petsc/Makefile.user for the preferred approach
#
#  You must set PETSC_DIR either via environment variable, or define here, or via 'make' command line
#  (and similarly PETSC_ARCH - especially when PETSc is built without --prefix, and with multiple PETSC_ARCH values)
#
# PETSC_DIR  =
# PETSC_ARCH =
#
#  This will use all the compiler flags that PETSc was compiled with, if you do not want the flags use $PETSC_DIR/share/petsc/Makefile.user
#  and modify it as noted in the comments
#
#  You can set specific values below, or specify to 'make' via command line, but that should be rarely needed
#
CPPFLAGS   = # Used by compile target for C sources
FPPFLAGS   = # Used by compile target for Fortran sources
CXXPPFLAGS = # Used by compile target for Cxx sources
CFLAGS     = # Used by both compile and link targets for C sources
FFLAGS     = # Used by both compile and link targets for Fortran sources
CXXFLAGS   = # Used by both compile and link targets for Cxx sources
LDFLAGS    = # Used by link targets - option occurs after the linker, before objs, libraries
PRELIBS    = # Used by link targets - option occurs before PETSC_LIB
LIBS       = # Used by link targets - option occurs after PETSC_LIB

#  For example - a single source file (ex1.c or ex1.F90) can be compiled with:
#
#      make ex1
#
#  You do not need to edit this makefile at all.
#
#  For a multi-file case, suppose you have the source files app.c [with main()], b.c, and c.cxx,
#  the binary can be built by uncommenting the following line:
#
# app : b.o c.o
#
#  If the default link target above doesn't work (for any reason), and an explicit link target
#  is needed (say with FLINKER, or a different name for the binary), you may need to use
#  (with additional modifications - if needed):
#
# myapp : app.o b.o c.o
#	$(LINK.F) $^ $(LOADLIBES) $(LDLIBS) -o $@

include ${PETSC_DIR}/lib/petsc/conf/variables

#  To access the PETSc variables for the build, including compilers, compiler flags, libraries etc but
#  manage the build rules yourself (rarely needed) comment out the next lines
#
include ${PETSC_DIR}/lib/petsc/conf/rules

